// import { promisify } from 'util'
// import { resolve as r} from 'path'
// import { readFile, writeFileSync as wfs } from 'fs'
// import * as qs from 'querystring'

// promisify(readFile)(r(__dirname, '../package.json'))
//   .then(data => {
//     data = JSON.parse(data)
//     console.log(data)
//     wfs(r(__dirname, './name'), String(data.name), 'utf8')
//   })

// import { name, getName } from './ex'
// console.log(name, getName())

import { readFile } from 'fs'
import { promisify } from 'util'
import { resolve as r} from 'path'

async function init() {
  try {
    let data = await promisify(readFile)(r(__dirname, '../package.json')) // attation file path
    data = JSON.parse(data)
    console.log(data)
  } catch (error) {
    console.log(error)
  }
}

init()
